/*
 * @Description:
 * @Version: 2.0
 * @Autor: zhengzx
 * @Date: 2021-12-11 12:54:08
 * @LastEditors: 郑灶欣
 * @LastEditTime: 2021-12-17 15:40:54
 */
import { createRouter, createWebHashHistory } from "vue-router";
import Layout from "@/layout/index.vue";
const routes = [
  {
    path: "/login",
    name: "login",
    hide: true,
    component: () => import("@/views/login.vue"),
  },
  {
    path: "/",
    name: "home",
    redirect: "/home",
    component: Layout,
    meta: {
      title: "首页",
    },
    children: [
      {
        path: "home",
        name: "home",
        meta: {
          title: "首页",
        },
        component: () => import("@/views/home/index.vue"),
      },
    ],
  },
  {
    path: "/",
    name: "test",
    meta: {
      title: "组件",
    },
    component: Layout,
    children: [
      {
        path: "test/table",
        name: "table",
        meta: {
          title: "表格",
        },
        component: () => import("@/views/table/index.vue"),
      },
      {
        path: "test/table1",
        name: "table1",
        meta: {
          title: "树",
        },
        component: () => import("@/views/tree/index.vue"),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
